package edu.sias.question.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import edu.sias.question.domain.dto.QuestionDTO;
import edu.sias.userQuestion.domain.Submit;

import java.util.Map;

public class EsRespons {
    private static final ObjectMapper objectMapper = new ObjectMapper();

    public static QuestionDTO mapToQuestionDTO(Map<String, Object> sourceMap) {
        return objectMapper.convertValue(sourceMap, QuestionDTO.class);
}
    public static Submit SubmitMap(Map<String, Object> sourceMap) {
        return objectMapper.convertValue(sourceMap, Submit.class);
    }
}
